<template>
  <div>
    <van-nav-bar
  title="我的评论"
  left-text="返回"
  left-arrow
  @click-left="$router.go(-1)"
/>
<div class="commend-list">
    <template v-for="nestedArray in CommendList">
      <CommendItems v-for="comment in nestedArray" :item="comment" :key="comment.commentId"></CommendItems>
    </template>
  </div>
  </div>
</template>

<script>
import CommendItems from '@/components/CommendItems.vue';
import { mapState} from "vuex";
import {getMyCommend} from '@/api/user'
export default {
name:"Commend",
components:{
    CommendItems
},
data() {
    return {
        CommendList:[]
    };
},
computed: {
    //获取存储数据
  ...mapState('user',["userInfo"])
},
async created () {
  try {
    const res = await getMyCommend(this.userInfo.userId
);
// console.log(res);
    this.CommendList = [res.data];
    console.log('评论数据',this.CommendList);
  } catch (error) {
    console.log(error);
  }
  },
methods:{
}
}
</script>

<style lang="less" scoped>

</style>